
package com.tnl.domain.enums;

/**
 * the user status enum
 * 
 * @author 
 */
public enum UserStatus {

	ACTIVE(1, "Active", "The User is in active."),
	DELETED(2, "Deleted", "The User was deleted.");
	
	private int status;
	private String name;
	private String desc;

	UserStatus(int status, String name, String description) {
		this.status = status;
		this.name = name;
		this.desc = description;
	}

	public int getStatus() {
		return this.status;
	}

	public String getName() {
		return this.name;
	}

	public String getDescription() {
		return this.desc;
	}

	@Override
	public String toString() {
		return status + "=" + name + ". " + desc;
	}

	public static UserStatus toStatus(int status) {
		for (UserStatus ps : UserStatus.values()) {
			if (ps.getStatus() == status)
				return ps;
		}
		return null;
	}
}
